Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for TanStack Start #458

Merged
merged 9 commits into from
Jan 20, 2025
Merged

Support for TanStack Start #458

merged 9 commits into from
Jan 20, 2025

Conversation

sdorra
Copy link
Owner

@sdorra sdorra commented Jan 7, 2025

Closes #450

@sdorra sdorra added the enhancement New feature or request label Jan 7, 2025
@sdorra sdorra self-assigned this Jan 7, 2025
Copy link

changeset-bot bot commented Jan 7, 2025

🦋 Changeset detected

Latest commit: b55c65d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@content-collections/vite Patch
@content-collections/installer Minor
content-collections Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jan 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
content-collections ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 16, 2025 9:14pm

Copy link

pkg-pr-new bot commented Jan 7, 2025

Open in Stackblitz

@content-collections/cli

npm i https://pkg.pr.new/sdorra/content-collections/@content-collections/cli@458

@content-collections/installer

npm i https://pkg.pr.new/sdorra/content-collections/@content-collections/installer@458

content-collections

npm i https://pkg.pr.new/sdorra/content-collections@458

@content-collections/integrations

npm i https://pkg.pr.new/sdorra/content-collections/@content-collections/integrations@458

@content-collections/core

npm i https://pkg.pr.new/sdorra/content-collections/@content-collections/core@458

@content-collections/markdown

npm i https://pkg.pr.new/sdorra/content-collections/@content-collections/markdown@458

@content-collections/mdx

npm i https://pkg.pr.new/sdorra/content-collections/@content-collections/mdx@458

@content-collections/next

npm i https://pkg.pr.new/sdorra/content-collections/@content-collections/next@458

@content-collections/remix-vite

npm i https://pkg.pr.new/sdorra/content-collections/@content-collections/remix-vite@458

@content-collections/vinxi

npm i https://pkg.pr.new/sdorra/content-collections/@content-collections/vinxi@458

@content-collections/vite

npm i https://pkg.pr.new/sdorra/content-collections/@content-collections/vite@458

commit: b55c65d

@baptisteArno
Copy link
Contributor

What's the status? Can I help in any way?

@sdorra
Copy link
Owner Author

sdorra commented Jan 16, 2025

Sorry, i've been very busy in the last days. Help with testing would be good. You could use the pre release of the plugin:

npm install -D https://pkg.pr.new/sdorra/content-collections/@content-collections/vinxi@458
// or 
pnpm add -D https://pkg.pr.new/sdorra/content-collections/@content-collections/vinxi@458

And then follow the installation guide (step one can be skipped).

@sdorra sdorra marked this pull request as ready for review January 16, 2025 13:20
@baptisteArno
Copy link
Contributor

baptisteArno commented Jan 16, 2025

I confirm that it works perfectly and it also miraculously fixes the hydration issue I mention here. 🙌

@ally-ahmed
Copy link

ally-ahmed commented Jan 16, 2025

@baptisteArno Can you try deleting the .content-collections folder and try building for prod.

In dev the .content-collections folder is created but once you build for prod I am getting the following error

[vite:load-fallback] Could not load .../tss-blog-starter/.content-collections/generated (imported by app/routes/blog/$slug.tsx): ENOENT: no such file or directory, open '../tss-blog-starter/.content-collections/generated'

@baptisteArno
Copy link
Contributor

Right, I did not try the build script. I get the same error:

vinxi v0.5.1


⚙  Building your app...
vinxi v0.5.1


⚙ Building your router client...


📦 Compiling client router...
vinxi building router client in client mode

♻️  Generating routes...
✅ Processed routes in 126ms
vite v6.0.7 building for production...
✓ 89 modules transformed.
x Build failed in 226ms

[3:25:08 PM]  ERROR  [vite:load-fallback] Could not load /Users/baptistearno/Dev/typebot.io/apps/landing-page/.content-collections/generated (imported by app/routes/_layout/blog/$slug.tsx): ENOENT: no such file or directory, open '/Users/baptistearno/Dev/typebot.io/apps/landing-page/.content-collections/generated'

It seems it does not compile the content files

@sdorra
Copy link
Owner Author

sdorra commented Jan 16, 2025

Ok, it looks like that TanStack Start builds the client bundle first, but the vinxi adapter runs only on ssr. I've to check if Solid Start breaks if i make client the default.

@sdorra
Copy link
Owner Author

sdorra commented Jan 16, 2025

No Solid Starts breaks, because it starts with the ssr bundle.

Rename the package to make clear,
that it can be used for other frameworks such as TanStack Start.
We build our collections now on first configured non static router,
instead of always build with the ssr router.
This fixes production builds of TanStack Start.
Update Solid and Solid Start to their latest versions
to ensure that the Vinxi adapter works with these versions.
@sdorra
Copy link
Owner Author

sdorra commented Jan 16, 2025

I think i found a solution which works for both (91c7204).

@sdorra sdorra added the preview-release Deploy a preview release label Jan 16, 2025
@sdorra
Copy link
Owner Author

sdorra commented Jan 16, 2025

@baptisteArno @ally-ahmed can you test again? This time with https://pkg.pr.new/sdorra/content-collections/@content-collections/vinxi@b55c65d?

@ally-ahmed
Copy link

ally-ahmed commented Jan 17, 2025

It looks like it is working well both in dev and prod. 👍🏽 @sdorra

@sdorra sdorra merged commit a9c44ca into main Jan 20, 2025
9 checks passed
@sdorra sdorra deleted the feature/450_support_tanstack_start branch January 20, 2025 07:47
@github-actions github-actions bot mentioned this pull request Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request preview-release Deploy a preview release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Tanstack Start
3 participants